/*     */ package com.jcrj.action.office;
/*     */ 
/*     */ import com.jcrj.action.BaseAction;
/*     */ import com.jcrj.entity.OMemo;
/*     */ import com.jcrj.entity.OUser;
/*     */ import com.jcrj.service.ReportService;
/*     */ import java.io.PrintWriter;
/*     */ import java.text.SimpleDateFormat;
/*     */ import java.util.Date;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class MemoAction extends BaseAction
/*     */ {
/*     */   private ReportService reportService;
/*     */   private List<OMemo> memoList;
/*     */   private OMemo memo;
/*     */   private String userName;
/*     */   private String setDate;
/*     */   private String name;
/*     */   private String names;
/*     */   private String users;
/*     */   private long pageCount;
/*     */   private long totalCount;
/*     */   private String[] ids;
/*     */   private int id;
/*     */ 
/*     */   public String memoList()
/*     */   {
/*  28 */     OUser oUser = (OUser)super.getSession().get("userInfo");
/*  29 */     this.memoList = this.reportService
/*  30 */       .getMemo(oUser.getId().intValue(), super.getCurrentPage(), 
/*  30 */       this.name, "进行中");
/*  31 */     for (int i = 0; i < this.memoList.size(); i++) {
/*  32 */       ((OMemo)this.memoList.get(i)).setUserList(
/*  33 */         this.reportService.getUserName(null, 
/*  34 */         ((OMemo)this.memoList.get(i)).getMemoUserId()));
/*  35 */       if ((((OMemo)this.memoList.get(i)).getContent() == null) || 
/*  36 */         ("".equals(((OMemo)this.memoList.get(i)).getContent())) || 
/*  37 */         (((OMemo)this.memoList.get(i)).getContent().length() < 20)) continue;
/*  38 */       ((OMemo)this.memoList.get(i)).setContent(
/*  39 */         ((OMemo)this.memoList.get(i)).getContent().substring(0, 20) + 
/*  40 */         "...");
/*     */     }
/*     */ 
/*  44 */     this.totalCount = this.reportService.countMemo(oUser.getId().intValue(), this.name, "进行中").longValue();
/*  45 */     this.pageCount = ((this.totalCount - 1L) / 10L + 1L);
/*  46 */     return "success";
/*     */   }
/*     */ 
/*     */   public String memoListFinish() {
/*  50 */     OUser oUser = (OUser)super.getSession().get("userInfo");
/*  51 */     this.memoList = this.reportService
/*  52 */       .getMemo(oUser.getId().intValue(), super.getCurrentPage(), 
/*  52 */       this.name, "已完成");
/*  53 */     for (int i = 0; i < this.memoList.size(); i++) {
/*  54 */       ((OMemo)this.memoList.get(i)).setUserList(
/*  55 */         this.reportService.getUserName(null, 
/*  56 */         ((OMemo)this.memoList.get(i)).getMemoUserId()));
/*  57 */       if ((((OMemo)this.memoList.get(i)).getContent() == null) || 
/*  58 */         ("".equals(((OMemo)this.memoList.get(i)).getContent())) || 
/*  59 */         (((OMemo)this.memoList.get(i)).getContent().length() < 20)) continue;
/*  60 */       ((OMemo)this.memoList.get(i)).setContent(
/*  61 */         ((OMemo)this.memoList.get(i)).getContent().substring(0, 20) + 
/*  62 */         "...");
/*     */     }
/*     */ 
/*  66 */     this.totalCount = this.reportService.countMemo(oUser.getId().intValue(), this.name, "已完成").longValue();
/*  67 */     this.pageCount = ((this.totalCount - 1L) / 10L + 1L);
/*  68 */     return "success";
/*     */   }
/*     */ 
/*     */   public String memoSave() {
/*  72 */     this.memo = new OMemo();
/*  73 */     this.memo.setCreationTime(new Date());
/*  74 */     return "success";
/*     */   }
/*     */ 
/*     */   public String saveMemo() {
/*     */     try {
/*  79 */       OUser oUser = (OUser)super.getSession().get("userInfo");
/*  80 */       this.memo.setMyUserId(oUser.getId());
/*  81 */       this.memo.setType("进行中");
/*  82 */       this.reportService.saveMemo(this.memo);
/*  83 */       super.getResponse().getWriter().write("success");
/*  84 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/*  86 */       e.printStackTrace();
/*     */       try
/*     */       {
/*  89 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e1) {
/*  91 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/*  89 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e) {
/*  91 */         e.printStackTrace();
/*     */       }
/*     */     }
/*  94 */     return null;
/*     */   }
/*     */ 
/*     */   public String deleteMemo() {
/*     */     try {
/*  99 */       this.reportService.deleteMemo(this.ids);
/* 100 */       super.getResponse().getWriter().write("success");
/* 101 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 103 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 106 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e1) {
/* 108 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 106 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e) {
/* 108 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 111 */     return null;
/*     */   }
/*     */ 
/*     */   public String memoUpdate() {
/* 115 */     this.memo = this.reportService.getMemo(this.id);
/* 116 */     this.names = "";
/* 117 */     int i = 0;
/* 118 */     for (; i < 
/* 118 */       this.reportService.getUserName(null, this.memo.getMemoUserId()).size(); i++) {
/* 119 */       if (this.names == "")
/* 120 */         this.names = 
/* 121 */           (this.names + 
/* 121 */           ((OUser)this.reportService.getUserName(null, this.memo.getMemoUserId())
/* 121 */           .get(i)).getName());
/*     */       else {
/* 123 */         this.names = 
/* 124 */           (this.names + "," + 
/* 125 */           ((OUser)this.reportService.getUserName(null, this.memo.getMemoUserId())
/* 125 */           .get(i)).getName());
/*     */       }
/*     */     }
/* 128 */     this.users = this.memo.getMemoUserId();
/* 129 */     return "success";
/*     */   }
/*     */ 
/*     */   public String updateMemo() {
/*     */     try {
/* 134 */       OUser oUser = (OUser)super.getSession().get("userInfo");
/* 135 */       this.memo.setMyUserId(oUser.getId());
/* 136 */       this.memo.setType("进行中");
/* 137 */       this.reportService.updateMemo(this.memo);
/* 138 */       super.getResponse().getWriter().write("success");
/* 139 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 141 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 144 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e1) {
/* 146 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 144 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e) {
/* 146 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 149 */     return null;
/*     */   }
/*     */ 
/*     */   public String memoForNewGet() {
/* 153 */     return memoUpdate();
/*     */   }
/*     */ 
/*     */   public String memoSetoutEndNewAdd() {
/* 157 */     OUser oUser = (OUser)super.getSession().get("userInfo");
/* 158 */     this.userName = oUser.getName();
/* 159 */     Date dt = new Date();
/* 160 */     SimpleDateFormat matter1 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
/* 161 */     this.setDate = matter1.format(dt);
/* 162 */     return memoUpdate();
/*     */   }
/*     */ 
/*     */   public String addMemoSetoutEndNewForm() {
/*     */     try {
/* 167 */       this.memo.setType("已完成");
/* 168 */       this.reportService.updateMemo(this.memo);
/* 169 */       super.getResponse().getWriter().write("success");
/* 170 */       super.getResponse().getWriter().flush();
/*     */     } catch (Exception e) {
/* 172 */       e.printStackTrace();
/*     */       try
/*     */       {
/* 175 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e1) {
/* 177 */         e1.printStackTrace();
/*     */       }
/*     */     }
/*     */     finally
/*     */     {
/*     */       try
/*     */       {
/* 175 */         super.getResponse().getWriter().close();
/*     */       } catch (Exception e) {
/* 177 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 180 */     return null;
/*     */   }
/*     */ 
/*     */   public String memoEndNew() {
/* 184 */     return memoUpdate();
/*     */   }
/*     */ 
/*     */   public ReportService getReportService()
/*     */   {
/* 189 */     return this.reportService;
/*     */   }
/*     */ 
/*     */   public void setReportService(ReportService reportService) {
/* 193 */     this.reportService = reportService;
/*     */   }
/*     */ 
/*     */   public List<OMemo> getMemoList() {
/* 197 */     return this.memoList;
/*     */   }
/*     */ 
/*     */   public void setMemoList(List<OMemo> memoList) {
/* 201 */     this.memoList = memoList;
/*     */   }
/*     */ 
/*     */   public OMemo getMemo() {
/* 205 */     return this.memo;
/*     */   }
/*     */ 
/*     */   public void setMemo(OMemo memo) {
/* 209 */     this.memo = memo;
/*     */   }
/*     */ 
/*     */   public String getUserName() {
/* 213 */     return this.userName;
/*     */   }
/*     */ 
/*     */   public void setUserName(String userName) {
/* 217 */     this.userName = userName;
/*     */   }
/*     */ 
/*     */   public String getSetDate() {
/* 221 */     return this.setDate;
/*     */   }
/*     */ 
/*     */   public void setSetDate(String setDate) {
/* 225 */     this.setDate = setDate;
/*     */   }
/*     */ 
/*     */   public String getName() {
/* 229 */     return this.name;
/*     */   }
/*     */ 
/*     */   public void setName(String name) {
/* 233 */     this.name = name;
/*     */   }
/*     */ 
/*     */   public long getPageCount() {
/* 237 */     return this.pageCount;
/*     */   }
/*     */ 
/*     */   public void setPageCount(long pageCount) {
/* 241 */     this.pageCount = pageCount;
/*     */   }
/*     */ 
/*     */   public long getTotalCount() {
/* 245 */     return this.totalCount;
/*     */   }
/*     */ 
/*     */   public void setTotalCount(long totalCount) {
/* 249 */     this.totalCount = totalCount;
/*     */   }
/*     */ 
/*     */   public String[] getIds() {
/* 253 */     return this.ids;
/*     */   }
/*     */ 
/*     */   public void setIds(String[] ids) {
/* 257 */     this.ids = ids;
/*     */   }
/*     */ 
/*     */   public int getId() {
/* 261 */     return this.id;
/*     */   }
/*     */ 
/*     */   public void setId(int id) {
/* 265 */     this.id = id;
/*     */   }
/*     */ 
/*     */   public String getNames() {
/* 269 */     return this.names;
/*     */   }
/*     */ 
/*     */   public void setNames(String names) {
/* 273 */     this.names = names;
/*     */   }
/*     */ 
/*     */   public String getUsers() {
/* 277 */     return this.users;
/*     */   }
/*     */ 
/*     */   public void setUsers(String users) {
/* 281 */     this.users = users;
/*     */   }
/*     */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.action.office.MemoAction
 * JD-Core Version:    0.6.0
 */